<?php
$s="123计算机";
echo strlen($s),"\n";
echo mb_strlen($s),"\n";
var_dump(strcmp("Hello","Hi"));
var_dump(strcmp("Hi","hi"));
var_dump(strcmp("Hi~","Hi"));
var_dump(strcasecmp("Hi","hi"));
$s="  \t \t How are you?  \t   ";
echo "[$s]\n";
echo "[", trim($s), "]\n";
echo "[", ltrim($s), "]\n";
echo "[", rtrim($s), "]\n";
echo "[", trim(",.;'Hello___","_.,';"), "]\n";
$s="How old are you?";
echo strpos($s,"o"),"\n";
echo strrpos($s,"o"),"\n";
$pos=0;
echo $pos=strpos($s,"o", $pos),"\n";
echo $pos=strpos($s,"o", ++$pos),"\n";
echo $pos=strpos($s,"o", ++$pos),"\n";
var_dump($pos=strpos($s,"o", ++$pos));
$a='计算机123';
echo bin2hex($a),"\n";
echo hex2bin('e8aea1e7ae97e69cba313233'),"\n";

echo chunk_split("123456",2,":"),"\n";
echo chunk_split("e8aea1e7ae97e69cba313233",2," "),"\n";
echo chunk_split("e8aea1e7ae97e69cba313233",2,"_"),"\n";
$s="How old are you?";
echo str_replace('o','**',$s),"\n";
echo str_replace(['o','r'],'*',$s),"\n";
echo str_replace(['o','r'],['O','R'],$s),"\n";
print_r(str_replace(['o','r'],['O','R'],[$s,'Hero']));
echo str_replace(' ','',$s),"\n";
echo str_replace(' ','',$s),"\n";
echo str_repeat('Ok',3),"\n";
echo '[',str_repeat('Ok',0),"]\n";
